else
this.emit('startup-prepared');
- this._startupAnimation();
+ try {
+ await this._startupAnimation();
+ } finally {
+ this._startupAnimationComplete();
+ }
}
- _startupAnimation() {
+ async _startupAnimation() {
if (Meta.is_restart())
- this._startupAnimationComplete();
- else if (Main.sessionMode.isGreeter)
- this._startupAnimationGreeter();
+ return;
+
+ if (Main.sessionMode.isGreeter)
+ await this._startupAnimationGreeter();
else
- this._startupAnimationSession();
+ await this._startupAnimationSession();
}
- _startupAnimationGreeter() {
- this.panelBox.ease({
- translation_y: 0,
- duration: STARTUP_ANIMATION_TIME,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- onStopped: () => this._startupAnimationComplete(),
+ async _startupAnimationGreeter() {
+ await new Promise(resolve => {
+ this.panelBox.ease({
+ translation_y: 0,
+ duration: STARTUP_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onStopped: () => resolve(),
+ });
});
}
- _startupAnimationSession() {
- const onStopped = () => this._startupAnimationComplete();
+ async _startupAnimationSession() {
if (Main.sessionMode.hasOverview) {
- Main.overview.runStartupAnimation(onStopped);
+ await Main.overview.runStartupAnimation();
} else {
- this.uiGroup.ease({
- scale_x: 1,
- scale_y: 1,
- opacity: 255,
- duration: STARTUP_ANIMATION_TIME,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- onStopped,
+ await new Promise(resolve => {
+ this.uiGroup.ease({
+ scale_x: 1,
+ scale_y: 1,
+ opacity: 255,
+ duration: STARTUP_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onStopped: () => resolve(),
+ });
});
}
}
this._controls.animateFromOverview(callback);
}
- runStartupAnimation(callback) {
- this._controls.runStartupAnimation(callback);
+ async runStartupAnimation() {
+ await this._controls.runStartupAnimation();
}
get dash() {
this._overview.controls.appDisplay.selectApp(id);
}
- runStartupAnimation(callback) {
+ async runStartupAnimation() {
Main.panel.style = 'transition-duration: 0ms;';
this._shown = true;
this._changeShownState(OverviewShownState.SHOWING);
- this._overview.runStartupAnimation(() => {
- // Overview got hidden during startup animation
- if (this._shownState !== OverviewShownState.SHOWING) {
- callback();
- return;
- }
+ await this._overview.runStartupAnimation();
- if (!this._syncGrab()) {
- callback();
- this.hide();
- return;
- }
+ // Overview got hidden during startup animation
+ if (this._shownState !== OverviewShownState.SHOWING)
+ return;
- Main.panel.style = null;
- this._changeShownState(OverviewShownState.SHOWN);
- callback();
- });
+ if (!this._syncGrab()) {
+ this.hide();
+ return;
+ }
+
+ Main.panel.style = null;
+ this._changeShownState(OverviewShownState.SHOWN);
}
getShowAppsButton() {
this._stateAdjustment.gestureInProgress = false;
}
- async runStartupAnimation(callback) {
+ async runStartupAnimation() {
this._ignoreShowAppsButtonToggle = true;
this.prepareToEnterOverview();
});
// The Dash rises from the bottom. This is the last animation to finish,
- // so run the callback there.
+ // so resolve the promise there.
this.dash.translation_y = this.dash.height + this.dash.margin_bottom;
- this.dash.ease({
- translation_y: 0,
- delay: STARTUP_ANIMATION_TIME,
- duration: STARTUP_ANIMATION_TIME,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- onStopped: () => callback(),
+ return new Promise(resolve => {
+ this.dash.ease({
+ translation_y: 0,
+ delay: STARTUP_ANIMATION_TIME,
+ duration: STARTUP_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onStopped: () => resolve(),
+ });
});
}